package com.example.fbsmobile;

import java.io.IOException;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams;

public class BookingStatus
{
	public static String Update(String id, String status)
	{
		String result = "Not successful";
		HttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new
        HttpPost("http://localhost:8081/FBS.Team7/UpdateBookingServlet");
        
        HttpParams postParams = new BasicHttpParams();
        postParams.setParameter("id", id);
        postParams.setParameter("status", status);
        httpPost.setParams(postParams);
        
        try
		{
			httpClient.execute(httpPost);
			result = "successful";
		} catch (ClientProtocolException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        return result;
	}
}
